/*
* ============================================================================
*  Name     : CKeyLockerContainer from KeyLockerContainer.h
*  Part of  : KeyLocker
*  Created  : 28.12.2005 by DANG Zhengfa
*  Description:
*     Declares container control for application.
*  Version  :
*  Copyright: Zhengfa Company Limited
* ============================================================================
*/

#ifndef KEYLOCKERCONTAINER_H
#define KEYLOCKERCONTAINER_H

// INCLUDES
#include <coecntrl.h>
   
// FORWARD DECLARATIONS
class CAknDoubleLargeStyleListBox;        // for listbox
// class CDesCArrayFlat;   // for items in listbox, it doesn't work, just include the header file
#include <badesca.h>   // for CDesCArrayFlat, bafl.lib


// CLASS DECLARATION

/**
*  CKeyLockerContainer  container control class.
*  
*/
class CKeyLockerContainer : public CCoeControl, MCoeControlObserver
    {
    public: // Constructors and destructor
        
        /**
        * EPOC default constructor.
        * @param aRect Frame rectangle for container.
        */
        void ConstructL(const TRect& aRect);

        /**
        * Destructor.
        */
        ~CKeyLockerContainer();

    public: // New functions

    public: // Functions from base classes

    private: // Functions from base classes

       /**
        * From CoeControl,SizeChanged.
        */
        void SizeChanged();

       /**
        * From CoeControl,CountComponentControls.
        */
        TInt CountComponentControls() const;

       /**
        * From CCoeControl,ComponentControl.
        */
        CCoeControl* ComponentControl(TInt aIndex) const;

       /**
        * From CCoeControl,Draw.
        */
        void Draw(const TRect& aRect) const;
	
		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);       	


		/**
		* From MCoeControlObserver
		* Acts upon changes in the hosted control's state. 
		*
		* @param	aControl	The control changing its state
		* @param	aEventType	The type of control event 
		*/
        void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);
        
    private: //data
        
		CPeriodic* iPeriodic;
		TTimeIntervalMicroSeconds32  iDelay;
		TTimeIntervalMicroSeconds32  iInterval;

		CAknDoubleLargeStyleListBox* iListBox; // the saved games list
		TRect iListBoxRect;
		CDesCArrayFlat* iArray;  // item list for listbox

		HBufC* iTextServerStatus;
		HBufC* iTextServerOn;
		HBufC* iTextServerOff;
		HBufC* iTextSetting;
		HBufC* iTextSettingHint;
		HBufC* iTextUtilities;
		HBufC* iTextUtilitiesHint;
		

	public:
		void UpdateListBoxL(void);
		TInt GetSelectedItem(void);
	};

#endif

// End of File
